﻿using System;

namespace PmfWeb.Core.Attributes
{
    ///<summary>
    /// .NET帮助特性类
    ///</summary>
    [AttributeUsage(AttributeTargets.Property,AllowMultiple = true,Inherited = true)]
    //AttributeTargets 表示HelpAttributes特性可以应用的任何类,方法,变量,程序集,结构体等等上;
    //AllowMultiple 表示可以在一个对象(方法,变量,结构体等等)上可以应用多次;
    //Inherited  表示HelpAttributes声明在基类上时,子类是否可以继承(或者是否被覆盖的HelpAttributes声明覆盖)
    public class HelpAttributes : Attribute
    {
        private string _description;

        ///<summary>
        /// 构造器
        ///</summary>
        ///<param name="description">描述信息</param>
        public HelpAttributes(string description)
        {
            this._description = description;
        }

        ///<summary>
        /// 描述信息
        ///</summary>
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }
    }

    //HelpAttributes[] help = (HelpAttributes[])Attribute.GetCustomAttributes(typeof (Current), typeof (HelpAttributes));
    //Response.Write(help[0].Description);
    //PropertyInfo info = typeof (Current).GetProperty("Name");
    //helpattributes help = (helpattributes) attribute.getcustomattribute(info, typeof (helpattributes));
    //response.write(help.description);


}
